var mongoose = require('mongoose')
var express = require('express')

mongoose.connect('mongodb://localhost/mine', { useMongoClient: true })

var Schema = mongoose.Schema

var staffsSchema = new Schema({
  name: {
    type: String,
    required: true
  },
  gender: {
    type: String,
    // enum: [0, 1],
    // default: 0
  },
  age: {
    type: Number
  },
  position: {
    type: String
  },
  phone: {
    type: Number
  },
  address: {
    type: String
  },
})

// 直接导出模型构造函数
module.exports = mongoose.model('Staffs', staffsSchema)
